package com.lqq.designPattern.bulider_pattern.factory.factoryMethod;


//咖啡店
public class CoffeeStore {
    //
    private CoffeeFactory coffeeFactory;
    public void setCoffeeFactory(CoffeeFactory coffeeFactory) {
        this.coffeeFactory = coffeeFactory;
    }

    //点咖啡
    public Coffee orderCoffee() {
        //调用工厂生产咖啡
        Coffee coffee = coffeeFactory.createCoffee();
        //加糖加奶
        coffee.addSugar();
        coffee.addMilk();
        return coffee;
    }
}
